// Copyright (c) Omar AL Zabir. All rights reserved.
// For continued development and updates, visit http://msmvps.com/omar

using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;

using Dropthings.DataAccess;

namespace Dropthings.Business.Activities
{
    public partial class DeleteColumnActivity : System.Workflow.ComponentModel.Activity
	{
		public DeleteColumnActivity()
		{
			InitializeComponent();
		}



        public int ColumnId
        {
            get { return (int)GetValue(ColumnIdProperty); }
            set { SetValue(ColumnIdProperty, value); }
        }

        public static readonly DependencyProperty ColumnIdProperty =
            DependencyProperty.Register("ColumnId", typeof(int), typeof(DeleteColumnActivity));

        
        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            DatabaseHelper.DeleteByPK<Column, int>(DatabaseHelper.SubsystemEnum.Column, new int[] { this.ColumnId });
            return ActivityExecutionStatus.Closed;
        }
	}
}
